//.nav-menu .right .down ul li
//.nav-menu .inner-tab  .tab-close .close
//.nav-menu .inner-tab .tab-title span
(function () {
	
	var firstRow=$('.nav-menu .right .down ul li');
	var close=$('.nav-menu .inner-tab  .tab-close .close');
	var ul=$('.nav-menu .right .down ul');
	var innerTab=$('.nav-menu .inner-tab '); //
	var innerTabBtn=$('.nav-menu .inner-tab .tab-title span'); //
	
	//外层的前四个
	var firstRowOne=firstRow.eq(0);
	var firstRowTwo=firstRow.eq(1);
	var firstRowThr=firstRow.eq(2);
	var firstRowFour=firstRow.eq(3);
	//计数器，用来判断当前时候需要响应第四个的hover事件
	var RowFourHoverNum=0;
	//关闭按钮
	close.click(function () {
		
		
		innerTab.slideUp(200);
		ul.slideDown(200);

		
	});
	//hover 动画
	function hoverAnin () {
		innerTab.slideDown(100);
		ul.slideUp(100);
	}
	
	//外层四个的事件
	firstRowOne.hover(function () {
		hoverAnin ();
		
		RowFourHoverNum=-1;
		innerTabBtn.eq(0).trigger('mouseenter');
	});
	firstRowTwo.hover(function () {
		
		hoverAnin ();
		RowFourHoverNum=-1;
		innerTabBtn.eq(1).trigger('mouseenter');
		
	});
	firstRowThr.hover(function () {
		
		hoverAnin ();
		RowFourHoverNum=-1;
		innerTabBtn.eq(2).trigger('mouseenter');
		
	});
	firstRowFour.hover(function () {
		console.log(RowFourHoverNum);
		if(RowFourHoverNum==0){
			hoverAnin ();
		innerTabBtn.eq(3).trigger('mouseenter');
			
		}else{
			
			if (RowFourHoverNum==1) {
				RowFourHoverNum=-1;
			}
		}
		RowFourHoverNum++;
		
	},function () {
		
	});
	//内层4个的事件
	var lastEveryContItem=0;
	innerTabBtn.each(function (index,ele) {

		$(this).mouseenter(function () {
		innerTab.find('.every-cont .every-cont-item').eq(lastEveryContItem).hide();
			
			innerTab.find('.every-cont .every-cont-item').eq(index).show();//addClass('.cont-item-show')
			console.log(innerTab.find('.every-cont .every-cont-item').eq(index));
			console.log(index);
			lastEveryContItem=index;
		});
	
	});
	
})()